package com.waylau.spring.cloud.weather.controller;

import com.waylau.spring.cloud.weather.service.CityDataService;
import com.waylau.spring.cloud.weather.vo.City;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping
public class CityController {

	@Autowired
	private CityDataService cityDataService;

	@GetMapping("cities")
	public List<City> listCity() throws Exception {
		return cityDataService.cityList();
	}
}
